package com.kotlin.flong.coroutines

import kotlinx.coroutines.*

/**
 * @Author:liangjl
 * @Date: 2020/7/7-16:31
 * @Eamil:jilongliang@sina.com
 * @Description:
 * 协程上下文
 */
fun main() = runBlocking {

    var job1 = GlobalScope.launch {
        println("协程执行")
    }
    var job2 = GlobalScope.launch(Dispatchers.Unconfined) {
        println("协程执行")
    }
    var job3 = GlobalScope.launch(coroutineContext) {
        println("协程执行")
    }
    var job4 = GlobalScope.launch(newFixedThreadPoolContext(5, "线程")) {
        println("协程执行")
    }

    job1.join()
    job2.join()
    job3.join()
    job4.join()


}